package com.example.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2024-02-06
 * Time: 15:32
 */

// 不能在 @ComponentScan 能够扫描到的包及子包内，所以另起包

@Configuration
public class MyselfRule {

    @Bean
    public IRule myRule() {
        // 随机
        return new RandomRule();
    }
}
